package com.blb.service;

import com.blb.entity.Company;
import com.blb.entity.Order;
import com.baomidou.mybatisplus.extension.service.IService;
import com.blb.entity.Product;
import com.blb.entity.ProductionLine;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author HuaHao
 * @since 2019-11-15
 */
public interface IOrderService extends IService<Order> {


    List<Map<String,Object>> findAllOrderList(String supplierId,int start, int length, String orderId, String dealTime,String orderStatus);

    int count( String supplierId,String orderId,  String dealTime,String orderStatus);

    List<Map<String, Object>> getAll(String orderId, Date dealTime);

    List<Product> findAllProduct(String companyId);

    List<Company> findAllCustom(String companyId);

    void addOrder(Order order);

    void updateProduce(Order order);

    void updateGoods(Order order);

    List<String> findProductById(String companyId);

    Map<String, Object> findOrderByOrderID(String supplierId,String orderId);

    List<Map<String, Object>> findAllSort(String supplierId,int start, int length,String orderId);
    int countSort(String supplierId,String orderId);

    public List<ProductionLine> findAllProductionLine(String companyId);

    Order findNumberAndProduction(String orderId, String productLineId);

    void updateProductSort(Order order1);

    void updateOne(String orderId, String productLineId);

    Map<String,Object> findStatus( String orderId, String supplierId);

    /**
     * lifeng* 待生产订单列表显示 （订单表）
     * @return
     */
    List<Map<String,Object>> PendingOrder(@Param("start") int start, @Param("length") int length, @Param("orderId") String orderId, @Param("companyId") String companyId);

    /**
     * lifeng
     * 计算数据总数
     * @param orderId
     * @return
     */
    int count2(@Param("orderId") String orderId, @Param("companyId") String companyId);

    /**
     * lifeng
     * 加到打印激光列表
     * @param orderId
     * @param productTime
     * @param printer
     * @param productLineId
     */
    void updatePendingOrder(String orderId,String productTime,String printer,int productLineId,String companyId);
    /**
     * 将激光码状态从null变为0
     * @param orderId
     * @param companyId
     */
    void updateLStats(String orderId,String companyId);

    /**
     * lifeng
     * 消息提醒总数
     * @return
     */
    int remindNum();

    /**
     * 采购列表签收修改订单状态为已完成
     *xuyuanxin
     * @param orderId
     */
    void updateStatus(String orderId);

    /**
     采购列表签收修改车辆状态为无任务
     * xuyuanxin
     * @param orderId
     */
    void updateVehicle(String orderId);
    /**
     采购列表签收修改司机状态为无任务
     * xuyuanxin
     * @param orderId
     */
    void updateDriver(String orderId);
}
